#!/bin/bash

set -x
set -e

TOPLEVEL=$(git rev-parse --show-toplevel)

git rm -rf --ignore-unmatch --pathspec-from-file=$TOPLEVEL/config/os-sync/excluded-paths

coan source $(tr '\n' ' ' < $TOPLEVEL/config/os-sync/excluded-defines) -K --replace --filter cpp,h --recurse --no-transients . || true

$TOPLEVEL/scripts/clang-format-diff
